//
//  InformationPageViewController.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/10/22.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class InformationPageViewController: KMPageViewController {

    override func viewDidLoad() {
        topBarStyle()
        super.viewDidLoad()

        addMoreLabelButton()
        
        self.buttonBarView.snp.remakeConstraints { (make) in
            make.left.top.equalToSuperview()
            make.right.equalToSuperview().offset(RATIO_H(maxNum: -40))
            make.height.equalTo(RATIO_H(maxNum: 40))
        }
    }
    
    //AMRK: 顶部滚动条样式
    fileprivate func topBarStyle() {
        
        settings.style.buttonBarBackgroundColor = UIColor.clear
        settings.style.buttonBarItemTitleColor = UIColor.black
        settings.style.buttonBarItemBackgroundColor = UIColor.clear
        settings.style.selectedBarBackgroundColor = UIColor.red
        settings.style.buttonBarItemFont = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        settings.style.selectedBarHeight = 3
        settings.style.buttonBarHeight = RATIO_H(maxNum: 40)
        
        //修改选中字体颜色
        changeCurrentIndexProgressive = {(oldCell,newCell,progressPercentage,changeCurrentIndex,animated) in

            oldCell?.label.textColor = UIColor.black
            newCell?.label.textColor = UIColor.red

        }
    }
    
    //MARK: 添加更多标签按钮
    fileprivate func addMoreLabelButton() {
        
        let button = UIButton()
        button.layer.contents = #imageLiteral(resourceName: "bottom_arrow").cgImage
        button.addTarget(self, action: #selector(moreLabel), for: .touchUpInside)
        self.view.addSubview(button)
        
        button.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(RATIO_H(maxNum: 10))
            make.right.equalToSuperview().offset(RATIO_H(maxNum: -10))
            make.width.height.equalTo(RATIO_H(maxNum: 20))
        }
    }
    
    //MARK: 更多标签
    @objc func moreLabel() {
        
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    

    

}
